﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DefLib
{
    public class KeyEvent
    {
        private int m_event;

        public  void Clear()
        {
            m_event = 0;

        }
        public  void Up_Down()
        {
            m_event |= MessageEvent.KEY_UP;
        }
        public  void Up_Up()
        {
            m_event &= ~MessageEvent.KEY_UP;
            
        }
        public void Down_Down()
        {
            m_event |= MessageEvent.KEY_DOWN;
        }
        public void Down_Up()
        {
            m_event &= ~MessageEvent.KEY_DOWN;

        }
        public void Left_Down()
        {
            m_event |= MessageEvent.KEY_LEFT;
        }
        public void Left_Up()
        {
            m_event &= ~MessageEvent.KEY_LEFT;

        }
        public void Right_Down()
        {
            m_event |= MessageEvent.KEY_RIGHT;
        }
        public void Right_Up()
        {
            m_event &= ~MessageEvent.KEY_RIGHT;

        }
        public void Enter_Down()
        {
            m_event |= MessageEvent.KEY_ENTER;
        }
        public void Enter_Up()
        {
            m_event &= ~MessageEvent.KEY_ENTER;

        }
        
        public  bool isDown(int messager)
        {
            return ((m_event & messager) == messager);
        }
       


    }
}
